package com.zhentao.day05.pm;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;

public class RandomAccessFileTest {
  public static void main(String[] args) throws IOException {
    // 第二个参数,需要指明, 对文件如何操作, r 读 w 写
    RandomAccessFile file = new RandomAccessFile("./china.txt","rw");

    file.seek(5);

    int len = 0 ;

    while ((len = file.read()) != -1){
      System.out.println((char)len);
    }

    file.close();

  }
}
